package com.sunny.service.impl;



import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sunny.dao.UserMapper;
import com.sunny.entity.User;
import com.sunny.service.IUserService;

@Component("userService")
public class UserServiceImpl implements IUserService{
	
	@Autowired
	UserMapper userMapper;
	
	
	public void addUser(User user) {
		userMapper.add(user);
		
	}

	public void deleteUserById(int id) {
		userMapper.delete(id);
		
	}

	public void updateUser(User user) {
		userMapper.update(user);
		
	}


	@Override
	public User findUserById(int id) {
		return userMapper.find(id);
	}

	@Override
	public List<User> listUsers() {
		// TODO Auto-generated method stub
		return userMapper.list();
	}

}
